package file;
/**
 * BufferedWriter
 */

import java.io.*;

public class BuffWriter {
    private static void main(String[] args){
        File file=new File("e:\\cn.txt");
        try {
            BufferedWriter bw=new BufferedWriter(new FileWriter(file),1024);
            bw.write("456");
            bw.newLine();//换行
            bw.write("hdjks");
            bw.close();
            BufferedReader br=new BufferedReader(new FileReader(file));
            String s=br.readLine();
            while (s!=null){
                System.out.println(s);
                s=br.readLine();
            }
            br.close();
            PrintWriter out=new PrintWriter(System.out);
            out.print(3.1415926);
            out.write("中国");
            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
